using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using MarketPlace.Data.DomainModels;
using MarketPlace.Data.Bases;

namespace MarketPlace.Data.ManagerObjects
{
    public partial interface IContactInfoManager : IManagerBase<MarketPlace.Data.DomainModels.ContactInfo, long>
    {
		// Get Methods
		IList<ContactInfo> GetByCompanyId(System.Int64 company);
    }

    partial class ContactInfoManager : ManagerBase<MarketPlace.Data.DomainModels.ContactInfo, long>, IContactInfoManager
    {
		#region Constructors
		
		public ContactInfoManager() : base()
        {
        }
        public ContactInfoManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<ContactInfo> GetByCompanyId(System.Int64 company)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(ContactInfo));
			
			
			ICriteria companyCriteria = criteria.CreateCriteria("Company");
            companyCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", company));
			
			return criteria.List<ContactInfo>();
        }
		
		#endregion
    }
}